package com.coolwen.service;

import com.coolwen.dao.AddressMapper;
import com.coolwen.entity.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by user on 2016/7/5.
 */
@Service("addressService")
public class AddressServiceImpl implements AddressService {

    @Autowired
    private AddressMapper adDao;

    @Override
    public Address load(Integer id) {
        return adDao.load(id);
    }

    @Override
    public int delete(Integer id) {
        return adDao.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Address obj) {
        return adDao.updateByPrimaryKeySelective(obj);
    }

    @Override
    public int add(Address obj) {
        return adDao.insertSelective(obj);
    }

    @Override
    public List<Address> list() {
        return adDao.list();
    }

    @Override
    public List<Address> listByUid(Integer uid) {
        return adDao.listByUid(uid);
    }
}
